package com.yqya.springboot.mybatisplus.shardingjdbc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yqya.springboot.mybatisplus.shardingjdbc.biz.UserInfoBizService;
import com.yqya.springboot.mybatisplus.shardingjdbc.dto.UserInfoDTO;
import com.yqya.springboot.mybatisplus.shardingjdbc.vo.UserInfoVO;

/**
 * 测试示例
 *
 * @author Kevin
 * @date 2019-08-03
 */
@RestController
public class TestController {

    @Autowired
    private UserInfoBizService userInfoBizService;

    @PostMapping("/user")
    public UserInfoVO saveUser(UserInfoDTO dto) {
        UserInfoVO vo = userInfoBizService.saveUserInfo(dto);
        return vo;
    }

    @GetMapping("/user")
    public UserInfoVO findById(Long id) {
        UserInfoVO vo = userInfoBizService.findById(id);
        return vo;
    }

}
